package com.hqyj.dao;

import com.hqyj.pojo.ScoreManagement;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.util.HashMap;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author rock
 * @since 2021-11-12
 */
public interface ScoreManagementMapper extends BaseMapper<ScoreManagement> {

    //查询试卷名
    List<String > selectExamName();

    int selectAvgScore(Integer examId);

//    @Select("select * from score_management")
//    @Results(value = {
//            @Result(property = "",column = ""),
//            @Result(property = "student_id",column = "student",
//                one=@One(select="com.hqyj.dao.StudentMapper.selectStudentById"))
//            })
//    List<ScoreManagement> selectByStudent();

    /**
     * 通过试卷编号和考生编号判断 是否有成绩登记记录
     * */
    List<ScoreManagement> selectScoreManagementByExamIdAndStuId(@Param("examId") Integer examId,@Param("stuId") Integer stuId);

    //求及格率
    List<ScoreManagement> selectPassRate();
}
